﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for InfoWindow
/// </summary>
public class InfoWindow
{

    public delegate void EventHandlerForInfoWindow(object sender);
    public event EventHandlerForInfoWindow Opened;
    public event EventHandlerForInfoWindow Closed;

    public InfoWindow Clone()
    {
        InfoWindow info = new InfoWindow();
        info.Text = this.Text;
        info.StatusOpened = this.StatusOpened;
        return info;
    }
    private void OnOpened(object sender)
    {
        if (Opened != null)
        {
            Opened(sender);
        }
    }

    private void OnClosed(object sender)
    {
        if (Closed != null)
        {
            Closed(sender);
        }
    }

    private Boolean _statusOpened;

    public Boolean StatusOpened
    {
        get { return _statusOpened; }
        set { _statusOpened = value; }
    } 

    private string _Text;

    public string Text
    {
        get { return _Text; }
        set { _Text = value; }
    }

    public InfoWindow()
    {
        //
        // TODO: Add constructor logic here
        //
        _Text = "";
    }

    public override bool Equals(object obj)
    {
        if (obj == null)
        {
            return false;
        }

        // If parameter cannot be cast to Point return false.
        InfoWindow info = obj as InfoWindow;
        if ((System.Object)info == null)
        {
            return false;
        }
        // Return true if the fields match:
        return (info.StatusOpened == StatusOpened) && (info.Text == Text);
    }
}